import request from '@/utils/request'

// 分页查询用户列表
export function SearchUsersPage(params) {
  return request({
    url: 'User/MngSearchUsersPage',
    method: 'get',
    params
  })
}
// 查询没有职位的用户
export function GetNonJobPositionUsers(params) {
  return request({
    url: 'User/GetNonJobPositionUsers',
    method: 'get',
    params
  })
}
// 根据ID获取用户信息
export function GetUser(params) {
  return request({
    url: 'User/GetUser',
    method: 'get',
    params
  })
}
// 锁定或解锁用户
export function LockOrUnlock(params) {
  return request({
    url: 'User/LockOrUnlock',
    method: 'post', 
    data: params
  })
}
// 手动添加用户
export function ManualAddUser(params) {
  return request({
    url: 'User/ManualAddUser',
    method: 'post',
    data: params
  })
}
// 删除用户
export function DeleteUser(params) {
  return request({
    url: 'User/DeleteUser',
    method: 'delete',
    params
  })
}
// 删除用户
export function ManualRealPeopleConfirm(params) {
  return request({
    url: 'User/ManualRealPeopleConfirm',
    method: 'put',
    data: params
  })
}
// 删除用户
export function MngUpdateMyHeadImgAndRealName(params) {
  return request({
    url: 'User/MngUpdateMyHeadImgAndRealName',
    method: 'put',
    data: params
  })
}
// 删除用户
export function ModifyHeadImg(params) {
  return request({
    url: 'User/ModifyHeadImg',
    method: 'put',
    data: params
  })
}

export function uploadAvatar(data) {
  return request({
	  url: 'Resource/UploadToOss',
	  method: 'post',
	  data
  })
}

export function RestoreDeleteData(data) {
  return request({
	  url: 'Common/RestoreDeleteData',
	  method: 'post',
	  data
  })
}

export function login(data) {
  return request({
    url: '/vue-admin-template/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
